package com.dhcc.bpm.common.utils;

import com.dhcc.bpm.modules.system.entity.ExpSeqEntity;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 实现RowMapper接口，返回对象
 * */
public class TableNameMapper implements RowMapper<ExpSeqEntity> {

    @Override
    public ExpSeqEntity mapRow(ResultSet resultSet, int i) throws SQLException {
        //获取结果集中的数据
        String tabName = resultSet.getString("comments");
        String tableEname = resultSet.getString("table_name");
        //把数据封装成对象
        ExpSeqEntity tableName = new ExpSeqEntity();
        tableName.setTableName(tabName);
        tableName.setTableEname(tableEname);
        return tableName;
    }

}
